#define kindeditor(x)
	<link rel="stylesheet" href="/static/kindeditor/themes/default/default.css" />
	<link rel="stylesheet" href="/static/kindeditor/plugins/code/prettify.css" />
	<script charset="utf-8" src="/static/kindeditor/kindeditor-all-min.js"></script>
	<script charset="utf-8" src="/static/kindeditor/lang/zh-CN.js"></script>
	<script charset="utf-8" src="/static/kindeditor/plugins/code/prettify.js"></script>
	<script>
		function _#(x.index??)_initkindeditor(){
				var options={
						cssPath : '/static/kindeditor/plugins/code/prettify.css',
						uploadJson : '/kindeditor/upload_json',
						//uploadJson : '/image/upload_blob',
						fileManagerJson : '/kindeditor/file_manager_json',
						items: ['source', '|', 'fontname', 'fontsize', '|', 'forecolor', 'bold', 'italic', 'underline', '|', 'justifyleft', 'justifycenter', 'justifyright', '|', 'image', 'multiimage', '|', 'plainpaste', 'wordpaste', '|','fullscreen'],
						allowFileManager : true,
						extraFileUploadParams :  { uploadType : "#(x.uploadType)",typeCode:"#(x.typeCode)",attachId:"#(x.attachId)",table:"#(x.table)"},
						readonlyMode : #(readOnly??false),
						afterFocus:function(){
							var _name = $("#_#(x.index??)").attr("name").replace("token_", "");
							$("#_#(x.index??)").attr("name", _name);
							$("#form_token").val(1);
						},
						afterCreate : function() {
							var self = this;
							$("#btn_save").bind("click",function(){
								$("#_#(x.index??)").val(editor.html());
							});
						}
					};
				var editor = KindEditor.create('textarea[name="token_#(table??x.table).#(x.index??)"]', options);
		}
	</script>	
	#setLocal(val = x.value??'')
	#setLocal(token = "token_")
	#if (val != "")
	 	#setLocal(token = "")
	#end
	<textarea  id="_#(x.index??)" name="#(token)#(table??x.table).#(x.index??)" #(x.required??) data-type="kindEditor"  class="form-control" cols="100" rows="8" style="visibility:hidden;width:100%;height:#(x.height??'200px');">#(x.value??)</textarea>
#end